package com.atguigu.guli.service.edu;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import feign.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@ComponentScan({"com.atguigu.guli.service"})
@EnableDiscoveryClient
@EnableFeignClients
//@EnableSwagger2
//@MapperScan(basePackages = "com.atguigu.guli.service.edu.mapper")
public class ServiceEduApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceEduApplication.class, args);
    }


    @Bean
    public Logger.Level level(){
        //feign 客户端发起远程访问请求时才会输出日志
        return Logger.Level.FULL;//日志输出级别 为 debug级别
    }

    //负载均衡
//    @Bean
//    public IRule iRule(){
//        return new RandomRule();//不再以轮巡的方式  变为随机从活着的服务器里找一个 一般都使用默认的
//    }
}